local UIRoot = {};

function UIRoot:init()
    self.screenWidth=nil;
    self.screenHeight=nil;
    self.canvasScaler=nil;
end

function UIRoot:onStart()
    self.gameObject.name = "UIRoot";
    self.navigation = self:find("navigation");
    self.window = self:find("window");
    self.windowMask = self:find("window/mask");
    self.dialog = self:find("dialog");
    self.dialogMask = self:find("dialog/mask");
    Utils.setVisible(self.dialogMask,false);
    self.dialogMaskButton = self:find("dialog/mask",CButton);
    Utils.addClick(self.dialogMaskButton,function ()
        DialogMgr:getMainDialog():onMaskClick();
    end);
    self.canvasScaler = self:find(nil,CanvasScaler);
    self.screenWidth = self.canvasScaler.referenceResolution.x;
    self.screenHeight = self.canvasScaler.referenceResolution.y;
    Dispatcher:dispatch(EventType.InitUIRootFinish);
end

function UIRoot:onShow()
    
end

function UIRoot:onHide()

end

return ClassUtils:extends(UIRoot, Display);